import tuio
import time

tracking = tuio.Tracking()
print "loaded profiles:", tracking.profiles.keys()
print "list functions to access tracked objects:", tracking.get_helpers()

oids=set()
nids=set()
try:
    while 1:
        tracking.update()
        dir(tracking)
        for obj in tracking.cursors():
            nids.add(obj.sessionid)
#        print nids, oids, nids==oids
        if nids!=oids:
          print 'changed', list(nids)
        tmp=oids
        oids=nids
        nids=tmp
        nids.clear()
#        time.sleep(1)
except KeyboardInterrupt:
    tracking.stop()
